<%-- 
    Document   : index
    Created on : Sep 16, 2013, 3:44:38 PM
    Author     : CHIP
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
        <title>Timgiayto.com - Tìm giấy tờ - Mất giấy tờ - Rơi giấy tờ</title>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />

        <link href="css/superfish.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css"  href="css/print.css" media="print" />
        <link type='text/css' href='css/dropdownmenu.css' rel='stylesheet' media='screen' />

        <style type="text/css">
            .social-ring:after {
                clear: both;
                content: " ";
                display: block;
                font-size: 0;
                height: 0;
                line-height: 0;
                visibility: hidden;
                width: 0;
            }
            .social-ring {
                margin: 0 !important;
                padding: 0 !important;
                line-height: 20px !important;
                height: auto;
                font-size: 11px;
            }
            .social-ring-button {
                float: left !important;
                height: 30px;
                margin: 0 5px 0 0 !important;
                padding: 0 !important;
            }
            .social-ring .social-ring-button iframe {
                max-width: none !important;
            }
        </style>
        <link href="css/1-default.css" rel="stylesheet" type="text/css" />
        <!--        <link href="css/reset.css" rel="stylesheet" type="text/css" />-->

        <script>
            function loadXMLDoc(dname)
            {
                if (window.XMLHttpRequest)
                {
                    xhttp=new XMLHttpRequest();
                }
                else
                {
                    xhttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
                xhttp.open("GET",dname,false);
                xhttp.send("");
                return xhttp.responseXML;
            }



            function nsResolver(prefix) {
                return prefix == 'n' ? 'http://xml.netbeans.org/schema/informations' : null;
            }
            function search(){
                

                // Delete childNode;
                deleteDiv();
                
                var xml=loadXMLDoc("xml/information.xml");
                var searchValue = document.getElementById("txtSearchValue").value;
                var path="//n:information[contains(n:owner,'"+searchValue+"')]";
                // code for IE
                if (window.ActiveXObject)
                {
                    var nodes=xml.selectNodes(path);

                    for (i=0;i<nodes.length;i++)
                    {
                        document.write(nodes[i].childNodes[0].nodeValue);
                        document.write("<br>");
                    }
                }
                // code for Mozilla, Firefox, Opera, etc.
                else if (document.implementation && document.implementation.createDocument) {
                    var nodes = xml.evaluate(path, xml, nsResolver, XPathResult.ANY_TYPE, null);
                    var result = nodes.iterateNext();
                    var array = new Array();
                    while (result) {
                        array[0] = result.getElementsByTagName("id")[0].childNodes[0].nodeValue;
                        array[1] = result.getElementsByTagName("owner")[0].childNodes[0].nodeValue;
                        array[2] = result.getElementsByTagName("info")[0].childNodes[0].nodeValue;
                        array[3] = result.getElementsByTagName("type")[0].childNodes[0].nodeValue;
                        array[4] = result.getElementsByTagName("date")[0].childNodes[0].nodeValue;
                        array[5] = result.getElementsByTagName("category")[0].childNodes[0].nodeValue;
                        addDiv(array);
                        result = nodes.iterateNext();
                    }

                }
            }
            function addDiv(array){
                var div = document.createElement("div");
                div.setAttribute("class", "question_list");
                div.setAttribute("id", "question");
                div.innerHTML = "<h3><a href='detail.jsp?id="+array[0]+"' rel='bookmark'>"+array[5]+ array[0]+ " - "+ array[1] + " - "+ array[2] +"</a></h3><span class='post-time'>"+array[4]+"</span><br/><p><span class='pcate'>  <a href='http://www.timgiayto.com/c/bang-lai-xe'>"+array[3]+"</a></span></p>";
                var pa = document.getElementById("parent");
                pa.appendChild(div);
            }

            function deleteDiv(){
                var parent = document.getElementById("parent");
                parent.innerHTML = "";
                var h1 = document.createElement("h1");
                h1.setAttribute("class", "page_head");
                var searchValue = document.getElementById("txtSearchValue").value;
                h1.innerHTML = "Kết quả tìm kiếm - " + searchValue;
                var pa = document.getElementById("parent");
                pa.appendChild(h1);
            }

        </script>

    </head>

    <body>
        <div id="nav">
            <jsp:include page="nav.jsp"/>
        </div> <!-- nav #end -->

        <div id="header">
            <jsp:include page="header.jsp"/>
        </div> <!-- header #end -->
        <!--        <input type="text" id="txtSearchValue" />
                <input type="button" value="Search" onclick="return search()"/>-->
        <div id="wrapper">
            <div id="content"> <!-- Thay Thế -->
                <div class="content_top">
                    <div class="content_bottom" id="parent">
                        <h1 class="page_head" id="page_head">

                        </h1>
                        <div class="question_list" id="question">
                            <h3> <a href="http://www.timgiayto.com/ho-van-binh.html" rel="bookmark" title="Permanent Link to ho van binh">ho van binh</a></h3>
                            <span class="post-time">21-09-2013</span><br/>
                            <p>
                                <span class="pcate">  <a href="http://www.timgiayto.com/c/bang-lai-xe" title="View all posts in Bằng lái xe" rel="category tag">Bằng lái xe</a>, <a href="http://www.timgiayto.com/c/cmnd" title="View all posts in CMND" rel="category tag">CMND</a>, <a href="http://www.timgiayto.com/c/giay-to-xe" title="View all posts in Giấy tờ xe" rel="category tag">Giấy tờ xe</a>, <a href="http://www.timgiayto.com/c/do-vat-khac" title="View all posts in Đồ vật khác" rel="category tag">Đồ vật khác</a> </span>
                            </p>
                        </div> <!-- question #end -->


                    </div> <!-- End div content_bottom -->
                </div>
            </div> <!-- content #end -->

            <div id="sidebar" class="sidebar_spacer" >

                <div class="widget widget_nav_menu">
                    <jsp:include page="menu.jsp"/>
                </div>

                <div class="widget Widget_Simplicy_Post">
                    <jsp:include page="news-inc.jsp" />
                </div> <!-- And div widget Widget_Simplicy_Post -->

                <div class="widget widget_black_studio_tinymce">
                    <jsp:include page="ads.jsp"/>
                </div> <!-- sidebar #end -->
            </div> <!-- wrapper #end -->

            <div id="footer">
                <jsp:include page="footer.jsp"/>
            </div><!--footer end-->
        </div>
    </body>
</html>
